import { Axios } from "axios"
import { API_URL, Good } from "./constants"

const axios = new Axios({
  baseURL: API_URL
})

export function getGoods(): Good[] {
  // TODO: must cache!!!
  return [
    {
      title: "mouse1",
      description: "The best mouse in the world! It can transfer over 114514GiB of clicking events per nanoseconds. ",
      price: 10,
      imageSrc: "",
      id: 0
    },
    {
      title: "mouse2",
      description: "The best mouse in the world! It can transfer over 1919180GiB of clicking events per nanoseconds. ",
      price: 100,
      imageSrc: "",
      id: 1
    },
    {
      title: "mouse3",
      description: "The best mouse in the world! It can transfer over 114514TiB of clicking events per nanoseconds. ",
      price: 1000,
      imageSrc: "",
      id: 2
    },
    {
      title: "mouse4",
      description: "The best mouse in the world! It can transfer over 1919180TiB of clicking events per nanoseconds. ",
      price: 10000,
      imageSrc: "",
      id: 3
    },
  ]
}

export function getToken(username: string, password: string) {
  return Math.floor(Math.pow(36, 16) * Math.random()).toString(36)
}